package com.den.mapper;

import com.den.entity.Video;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface VideoMapper {
    //查询所有
    @Select("select id,username from video")
    List<Video> selectAllVideos();
    //根据id查询某行
    @Select("select id,username from video where id =#{id}")
    List selectVideoById(int id);
    //删除
    @Delete("delete from video where id=#{id}")
    int deleteVideoById(int id);
    //修改
    @Insert("insert into video(username) values (#{username})")
    int insertVideoById(Video video);
    //添加
    @Update("update video set username = username where id=id ")
    int updateVideoById(Video video);
}
